/**
 * 你可以设置theme的值，来控制界面的主题
 */
$(function () {
    //背景图片 b1-b6
    let loginBgName = "b6";//登录注册页背景
    let mainBgName = '';//主页背景

    //头部背景图
    //紫色花纹
    // $(".sidebar-header").attr("style", `background-image: url(${ctx}/assets/images/side/purple.jpg);background-repeat:no-repeat;background-size: cover`);
    //logo bg
    // $(".sidebar-header").attr("style", `background-image: url(${ctx}/assets/images/side/logobg.png);background-repeat:no-repeat;background-size: cover`);

    //侧边栏图片
    // 一个小png
    // $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/side1.png);background-size: 240px 120px;background-repeat:no-repeat`);
    //蓝色背景 配合暗黑主题+color_3
    // $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/bg-menu.png);background-repeat:no-repeat;background-size: cover`);
    //学校、城市
    $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/school.jpg);background-repeat:no-repeat;background-size: cover`);
    //紫色花纹
    // $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/purple.jpg);background-repeat:no-repeat;background-size: cover`);
    //蓝色线条纹路
    // $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/side2.jpg);background-repeat:no-repeat;background-size: cover`);
    //砖头
    // $(".lyear-layout-sidebar-scroll").attr("style", `background-image: url(${ctx}/assets/images/side/zhuan.jpg);background-repeat:no-repeat;background-size: cover`);

    //主题色、左上角logo背景色、头部背景色、侧边栏背景色
    $("body").attr("data-theme", "");//主题色  默认：default  暗黑：dark  幽兰：translucent
    $("body").attr("data-logobg", '');//默认：default 白色，color_2 ~ color_8 分别表示2绿 3蓝 4橙 5青 6紫 7深蓝 8黑
    $("body").attr("data-headerbg", '');
    $("body").attr("data-sidebarbg", '');




    //init
    //登录注册背景
    if (loginBgName !== '' )
        $(".loginBg").attr("style", `background-image: url(${ctx}/assets/images/${loginBgName}.jpg);background-size: cover;`);
    //页面背景
    if (mainBgName !== '')
        $("body").attr("style", `background-image: url(${ctx}/assets/images/${mainBgName}.jpg);background-size: cover;`);
})
/**
 * 侧边栏高亮
 */
function activeBar(item) {
    // //取消原先的高亮
    if($(".nav-item-active")){
        $(".nav-item-active").removeClass("nav-item-active");
    }
    //新页面高亮
    if($("." + item)){
        $("." + item).addClass("nav-item-active");
    }
}
